package com.lmb.todo.exception.advice;

import com.lmb.todo.pojo.resp.Code;
import com.lmb.todo.pojo.resp.CommonResp;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class ExceptionAdvice {

    @ExceptionHandler(Exception.class)
    public CommonResp handleException(Exception e) {
        return new CommonResp(null, Code.HTTP_FAILED, e.toString());
    }

}
